package com.zk.mylib.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import androidx.constraintlayout.motion.widget.MotionLayout
import com.zk.mylib.R

/**
 * 动画View
 */
class MotionLayout1Activity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_ui_motionlayout1)
        var motionlayout=findViewById<MotionLayout>(R.id.motionlayout)
        var button = findViewById<Button>(R.id.button)
        button.setOnClickListener {
            Toast.makeText(this,"开始被点击了",Toast.LENGTH_SHORT).show()
//            if(motionlayout){
//
//            }
//            if(motionlayout.getr){
//                Toast.makeText(this,"开始被点击了",Toast.LENGTH_SHORT).show()
//                motionlayout.transitionToEnd()
//            }else if(motionlayout.targetPosition==1F){
//                Toast.makeText(this,"结束被点击了",Toast.LENGTH_SHORT).show()
//                motionlayout.transitionToStart()
//            }else{
//                Toast.makeText(this,"中途被点击了",Toast.LENGTH_SHORT).show()
//            }

        }

    }
}